package lt.hsu.service;

import jakarta.validation.constraints.NotBlank;
import lt.hsu.req.RProduct;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@FeignClient(name = "PRODUCT-SERVICE") // 指定要调用的远程服务的名称
@RequestMapping("remote")
public interface RemoteProduct {

    @PostMapping("/product/list")
    List<RProduct> list();
    @PostMapping("/product/{productName}")
    RProduct findProduct(@NotBlank(message = "产品名不能为空") @PathVariable("productName") String productName);

}
